<?php

class Pruebas extends CI_Controller
{

    function __construct()
    {
        parent::__construct();

        $this->load->library('gf');
    }

    function index()
    {


        $array = array(
            'chango',
            & $p,
        );


        $p = '4';

        foreach ($array as $var)
        {
            echo $var . "<br>";
        }
    }

    function prueba2()
    {
        $query = "select * from estudios_analisis where id_cirugia=1";
        $rows = $this->db->query($query);
        $rows = $rows->result_array();

        foreach ($rows as $var)
        {
            echo 'ea_visto: ' . $var['ea_visto'];

            if ($var['ea_visto'] == '')
                echo "<br>chango";
        }
    }

    function prueba_co()
    {
        $query = "select * from pacientes where id_paciente=1";
        $row = $this->db->query($query);
        $row = $row->row_array();

        $ro = array(
            'p_nombre' => $row['p_nombre'],
            'p_apellido' => $row['p_apellido'],
            'p_fecha_nacimiento' => $row['p_fecha_nacimiento'],
            'p_dni' => $row['p_dni'],
            'p_numero_afiliado' => $row['p_numero_afiliado'],
            'p_localidad' => $row['p_localidad'],
            'p_telefono' => $row['p_telefono'],
            'p_historia_clinica' => $row['p_historia_clinica'],
            'id_obra_social' => $row['id_obra_social']
        );

       $tr="clas='chango'";


        $chango = "nada";

        $accion = "Se actualizo el paciente " . $row['p_apellido'] . ", " . $row['p_nombre'];
        $detalle = "  
                <table class='table'>
                    <tr><th>Campo<th>Valor viejo</th><th>Valor nuevo</th></tr>
                    <tr " . $tr . " ><td><b>Nombre</b></td><td>" . $chango . "</td><td>" . $chango . "<td></tr>
                    <tr " . $tr . " ><td><b>Apellido</b></td><td>" . $chango . "</td><td>" . $chango . "<td></tr>
                    <tr " . $chango . " ><td><b>Fecha Nacimiento</b></td><td>" . $chango . "</td><td>" . $chango . "<td></tr>
                    <tr " . $chango . " ><td><b>DNI</b></td><td>" . $chango . "</td><td>" . $chango . "<td></tr>
                    <tr " . $chango . " ><td><b>Numero Afiliado</b></td><td>" . $chango . "</td><td>" . $chango . "<td></tr>
                    <tr " . $chango . " ><td><b>Localidad</b></td><td>" . $chango . "</td><td>" . $chango . "<td></tr>
                    <tr " . $chango . " ><td><b>Telefóno</b></td><td>" . $chango . "</td><td>" . $chango . "<td></tr>
                    <tr " . $chango . " ><td><b>Obra social</b></td><td>" . $chango . "</td><td>" . $chango . "<td></tr>
                </table>";

        $act_array = array(
            'a_accion' => $accion,
            'a_detalle' => $detalle,
            'id_usuario' => 1
        );
        $this->db->insert('actividades', $act_array);
    }

    
    function fecha()
    {
        echo date( 'Y-m-d');
    }
}

?>
